define('formBuyIn',['text!../tpl/form-buyIn.html','tool','common'],function(Template,tool,common){
    var App ={
    	template:Template,
    	mixins: [tool.toor,common.common],
    	mounted:function(){
    		var _this=this;
    	},
    	data:function(){
    		return{
    			submitJson:{
				    "component": []
				},
				totalPrice:0
    		};
    	},
    	watch:{
    		
    	},
    	methods:
    	{
    		repeatFn:function(data)
    		{
    			this.totalPrice=0;
    			for(var i=0;i<data.length;i++)
    			{
    				if(data[i][4].value!='')
    				{
    					this.totalPrice+=parseFloat(data[i][4].value);
    				}
    			};
		     	if(data && data.length>0)
		     	{
		     	    for(var i=0;i<this.submitJson.component.length;i++)
		     	    {
		     	    	 var o=this.submitJson.component[i];
		     	    	 if(o.name=="明细")
		     	    	 {
		     	    	 	this.submitJson.component.splice(i,1)
		     	    	 }
		     	    };
		     		this.submitJson.component.push({
		     			  "name":"明细",
		     			  "value":JSON.stringify(data)
		     		});
		     	}
    		
    		}
    		
    	}
    };
    return {
        app:App       
    };
});